<?php Asset::container('front')->add('front_css', 'css/front/index.css');?>
<?php
$cname = Config::get('option.site.cname');
$description = Config::get('option.site.description');
$title = strip_tags($img->product->title) ."|{$cname}-{$description}";
$meta = array();
$meta['keywords'] = Config::get('option.site.keywords', '');
$meta['description'] = strip_tags($img->product->title);
?>
<?php echo View::make('share.front_header')->with('css', array('front'))->with('title', $title)->with('meta', $meta);?>
<?php $collections = Collection::all();?>
<?php echo View::make('share.front_nav')->with('collections', $collections)->with('cid', $img->collection_id)?>
<div id="wrap" class='container' style='margin-top:10px;'>
<div class="container">
  <div id='info'>
    <img src='<?php echo $img->url;?>' style='margin-top:10px;height:500px;width:500px;float:left;' />
    <div style='float:left;height:250px;width:400px;margin-left:15px;'>
      <p style='margin-top:30px;font-size:24px;font-weight:800;line-height:30px;'>
        <a style='text-decoration:none;' href='<?php echo $img->product->click_url;?>' target='_blank'><?php echo strip_tags($img->product->title);?></a>
      </p>
      <table style='margin-top:20px;' class='detail'>
        <tr>
          <td style='width:80px;text-align:left;font-size:14px;'><span style='color:#999;'>价格</span></td>
          <td><span style='font-size:27px;font-weight:700;color:#c00;vertical-align: baseline;font-family: tahoma, arial, 宋体;'><?php echo $img->product->price;?></span><span style='color:#999;'>&nbsp;元</span></td>
        </tr>
        <tr>
          <td style='width:80px;text-align:left;font-size:14px;'><span style='color:#999;'>月销量</span></td>
          <td><span style='font-size:18px;color:#C31815;font-family: tahoma, arial, 宋体;'><?php echo $img->product->commission_num;?></span><span style='color:#999;'>&nbsp;件</span></td>
        </tr>
        <tr>
          <td style='width:80px;text-align:left;font-size:14px;'><span style='color:#999;'>卖家</span></td>
          <td>
            <?php if (trim($img->product->shop_click_url) != ''):?>
            <span style='color:#999;'><a href='<?php echo $img->product->shop_click_url;?>'><?php echo $img->product->nick;?></a></span></td>
            <?php else :?>
            <span class='label'><?php echo $img->product->nick;?></span></td>
            <?php endif;?>
        </tr>
        <?php if (trim($img->product->seller_credit_score)!=''):?>
        <tr>
          <td style='width:80px;text-align:left;font-size:14px;'><span style='color:#999;'>信用等级</span></td>
          <td>
            <span class='label'><?php echo $img->product->seller_credit_score;?></span></td>
        </tr>
	<?php endif;?>
      </table>
<!-- JiaThis Button BEGIN -->
<div class="jiathis_style pull-left" style='margin:10px;'>
	<a class="jiathis_button_qzone"></a>
	<a class="jiathis_button_tsina"></a>
	<a class="jiathis_button_tqq"></a>
	<a class="jiathis_button_renren"></a>
	<a class="jiathis_button_kaixin001"></a>
	<a href="http://www.jiathis.com/share" class="jiathis jiathis_txt jtico jtico_jiathis" target="_blank"></a>
	<a class="jiathis_counter_style"></a>
</div>
<!-- JiaThis Button END -->
      <a class='btn btn-success btn-mini pull-right' href='<?php echo $img->product->click_url;?>' target='_blank'><i class='icon-shopping-cart icon-white'></i>去购买</a>
<!--
      <a class='btn btn-primary btn-mini pull-right' style='margin-right:5px;'><i class='icon-star icon-white'></i>收藏</a>
-->
      <div>
      </div>
    </div>
    <div style='float:left;height:300px;width:400px;margin-left:15px;'>
    <span class='label label-info'>猜你喜欢</span>
    <?php $cnt = Img::where('collection_id', '=', $img->collection_id)->count();?>
    <?php $imgs = Img::with('product')->where('id', '!=', $img->id)->where('collection_id', '=', $img->collection_id)->skip(rand(0, $cnt-8))->take(8)->get();?>
    <ul class='unstyled' style='margin-top:10px;'>
    <? foreach ($imgs as $i):?>
      <li style='float:left;padding:5px;width:89px;height:120px;'>
      <a href='/item/?id=<?php echo $i->id;?>' target='_blank'><img class='guess' src='<?php echo $i->url . '_120x120.jpg';?>' title='<?php echo strip_tags($i->product->title);?>' alt='<?php echo strip_tags($i->product->title);?>' style='width:85px;height:85px;border:2px solid white;'/></a>
      </li>
    <?php endforeach;?>
    <ul>
  </div>
<!-- Duoshuo Comment BEGIN -->
	<div class="ds-thread"></div>
	<script type="text/javascript">
	var duoshuoQuery = {short_name:"qingchunfang"};
	(function() {
		var ds = document.createElement('script');
		ds.type = 'text/javascript';ds.async = true;
		ds.src = 'http://static.duoshuo.com/embed.js';
		ds.charset = 'UTF-8';
		(document.getElementsByTagName('head')[0] 
		|| document.getElementsByTagName('body')[0]).appendChild(ds);
	})();
	</script>
<!-- Duoshuo Comment END -->
   
</div>
</div>
<?php Asset::container('item')->add('item_script', 'http://v3.jiathis.com/code/jia.js?uid=1350809600080348');?>
<?php echo View::make('share.front_footer')->with('script', array('item'));?>
<style>
#info .detail td{
padding:5px;
}
</style>
